﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using YJKSparseDistance.ModelLayer;
using YJKRevitKernel.ShortPathSuite;

namespace YJKSparseDistance.ControlLayer
{
    public class ShortDistanceCalculater : YJKRevitKernel.ShortPathSuite.ShortDistanceCalculater
	{
		public List<XYZ> CalculateShortPath(EndPointPacker startPoint, EndPointPacker endPoint, List<Curve> allRunWay)
		{
			List<XYZ> list = new List<XYZ>();
			List<XYZ> list2 = base.CalculateShortPath(startPoint.UseEndPoint, endPoint.UseEndPoint, allRunWay);
			if (list2 == null)
			{
				return null;
			}
			if (startPoint.AppendPoint != null)
			{
				list.Add(startPoint.AppendPoint);
			}
			list.AddRange(list2);
			if (endPoint.AppendPoint != null)
			{
				list.Add(endPoint.AppendPoint);
			}
			return list;
		}
	}
}
